Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
23 lines (18 loc) · 717 Bytes

7.2.6 - Http/Request->$files.md

File metadata and controls

23 lines (18 loc) · 717 Bytes

Http\Request->$files

文件上传信息。类型为以form名称为key的二维数组。与PHP$_FILES相同。最大文件尺寸不得超过package_max_length设置的值。请勿使用Swoole\Http\Server处理大文件上传。

Array
(
    [name] => facepalm.jpg
    [type] => image/jpeg
    [tmp_name] => /tmp/swoole.upfile.n3FmFr
    [error] => 0
    [size] => 15476
)
  • name 浏览器上传时传入的文件名称
  • type MIME类型
  • tmp_name 上传的临时文件,文件名以/tmp/swoole.upfile开头
  • size 文件尺寸
  • 1.9.10以上版本支持is_uploaded_filemove_uploaded_file函数

$request对象销毁时,会自动删除上传的临时文件